home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 2 / LSD and 17bit Compendium Deluxe - Volume II.iso / a / prog / misc / date.lha / Date / M2 / txt / Date.doc < prev    next >
Text File  |  1994-11-30  |  59KB  |  2,467 lines

  1. TABLE OF CONTENTS
  2.  
  3. Date/--background--
  4. Date/--history--
  5. Date/GregorianDayDiff
  6. Date/GregorianDayGreater
  7. Date/GregorianDaysAfterWeekday
  8. Date/GregorianDaysBeforeWeekday
  9. Date/GregorianDaySmaller
  10. Date/GregorianDiffDate
  11. Date/GregorianEaster
  12. Date/GregorianLeapYear
  13. Date/GregorianMonthDays
  14. Date/GregorianMoonAge
  15. Date/GregorianToJD
  16. Date/GregorianWeek
  17. Date/GregorianWeekday
  18. Date/GregorianYearDays
  19. Date/GSYearToJD
  20. Date/GYearToScaliger
  21. Date/HeisDayDiff
  22. Date/HeisDayGreater
  23. Date/HeisDaysAfterWeekday
  24. Date/HeisDaysBeforeWeekday
  25. Date/HeisDaySmaller
  26. Date/HeisDiffDate
  27. Date/HeisLeapYear
  28. Date/HeisMonthDays
  29. Date/HeisToJD
  30. Date/HeisWeek
  31. Date/HeisWeekday
  32. Date/HeisYearDays
  33. Date/HSYearToJD
  34. Date/HYearToScaliger
  35. Date/JDtoMJD
  36. Date/JDToTime
  37. Date/JSYearToJD
  38. Date/JulianDayDiff
  39. Date/JulianDayGreater
  40. Date/JulianDaysAfterWeekday
  41. Date/JulianDaysBeforeWeekday
  42. Date/JulianDaySmaller
  43. Date/JulianDiffDate
  44. Date/JulianLeapYear
  45. Date/JulianMonthDays
  46. Date/JulianToJD
  47. Date/JulianWeek
  48. Date/JulianWeekday
  49. Date/JulianYearDays
  50. Date/JYearToScaliger
  51. Date/LMT
  52. Date/MJDtoJD
  53. Date/ScaligerYearToG
  54. Date/ScaligerYearToH
  55. Date/ScaligerYearToJ
  56. Date/SecToTime
  57. Date/TimeToJD
  58. Date/TimeToSec
  59. Date/TimeZoneFactor
  60. Date/--background--                                       Date/--background--
  61.  
  62.    NAME
  63.     Date -- This module was designed to help calc. calendar dates (V33)
  64.  
  65.    FUNCTION
  66.     I know about the date routines in the Amiga-OS(TM), but I decided
  67.     not to use them, because of their limited functionalities and of
  68.     the portability of this module!
  69.  
  70.    NOTES
  71.     A tropical year is 365.2422 days! / 365d, 5h, 48min, 46sec
  72.     A moon month is 29.53059 days! / 29d, 12h, 44min, 2.9 sec
  73.     A moon phase is 7.38265 days!
  74.  
  75.     (German) Books which helped me creating this library:
  76.         Kleine Naturwissenschaftliche Bibliothek, Band 23
  77.         Ewige Kalender
  78.         A.W. Butkewitsch & M.S. Selikson
  79.         5. Auflage
  80.         Teubner, Leipzig 1974
  81.         ISBN 3-322-00393-0
  82.  
  83.         Tag und Woche, Monat und Jahr: eine Kulturgeschichte des
  84.         Kalenders
  85.         Rudolf Wendorff
  86.         Westdeutscher, Opladen 1993
  87.         ISBN 3-531-12417-X
  88.  
  89.         Kalender und Chronologie: Bekanntes & Unbekanntes aus der
  90.         Kalenderwissenschaft
  91.         Heinz Zemanek
  92.         4. Auflage
  93.         Oldenbourg, München 1987
  94.         ISBN 3-486-20447-5
  95.  
  96.         Meyers Handbuch
  97.         über das Weltall
  98.         Karl Schaifers & Gerhard Traving
  99.         5. Auflage
  100.         Bibliographisches Institut Mannheim 1973
  101.         ISBN 3-411-00940-3
  102.  
  103.         Meyers Handbuch
  104.         über das Weltall
  105.         Karl Schaifers & Gerhard Traving
  106.         5. Auflage
  107.         Bibliographisches Institut Mannheim 1973
  108.         ISBN 3-411-00940-3
  109.  
  110.     (English) Books which helped me creating this library:
  111.         Mathematical Astronomy with a Pocket Calculator
  112.         Aubrey Jones Fras
  113.         unknown(first) Edition
  114.         David & Charles Newton Abbot, London 1978
  115.         ISBN 0-7153-7675-6
  116.  
  117.    COPYRIGHT
  118.     This module is Copyright 1994 by Kai Hofmann - all rights reserved!
  119.     For private use, Public Domain, Gift Ware, Freeware and Shareware
  120.     you could use this module under following conditions:
  121.     - You send me a little gift (money is very welcome :)
  122.         For Bank Account see below - but *ONLY* send in DM
  123.         to this Bank Account!!!
  124.       Other nice gifts: all Amiga hardware, and I am searching for a
  125.       good old 1541 (C64 floppy)
  126.     - You include a notice in your product, that you use this library
  127.       and that it is Copyright by Kai Hofmann!
  128.     If you want to redistribute this library read the following points:
  129.     - Redistribution warranty is given to:
  130.         Fred Fish for his great Amiga-Software-Library
  131.         The German SAAR AG PD-Library
  132.         The German AMOK PD-Library
  133.         All public accessible INTERNET servers and PHONE boxes!
  134.         All other who NOT take more than DM 5.- for one disk
  135.         ALL other who NOT take more than DM 50.- for one CD
  136.     For commercial use send me DM 200.-
  137.     But if you are Apple or Microsoft you have to send (20000.- US$)
  138.  
  139.    DISCLAIMER
  140.  
  141.       THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
  142.    APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
  143.    HOLDER AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
  144.    OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
  145.    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  146.    PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
  147.    PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE
  148.    COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
  149.  
  150.       IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
  151.    WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY REDISTRIBUTE THE
  152.    PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
  153.    GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
  154.    USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS
  155.    OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR
  156.    THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
  157.    PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
  158.    POSSIBILITY OF SUCH DAMAGES.
  159.  
  160.    ADDITIONAL INFORMATIONS
  161.     I have tried to make portable/usefull and I hope bugfree software
  162.     for eternity - but this seems to be impossible (sorry!) :)
  163.     So I hope you will pay a fee for this.
  164.  
  165.    AUTHOR
  166.     Kai Hofmann
  167.     Arberger Heerstraße 92
  168.     28307 Bremen
  169.     Germany
  170.     EMail: i07m@alf.zfn.uni-bremen.de
  171.     (no phone - I hate it!)
  172.  
  173.     Bank account : 1203 7503
  174.     Account owner: Kai Hofmann
  175.     Bank code    : 290 501 01
  176.     Bank name    : Sparkasse in Bremen
  177.     Bank address : 28307 Bremen / Germany
  178.  
  179.    THANX
  180.     Thanx are going to the following people:
  181.     Danial Armor        - For his hint about the Oberon-2 SHORT
  182.                   command
  183.     Heinz Zemanek        - For his great book
  184.     Christian Schaefer    - For spending time on this lib with his
  185.                   Borland C++ 4.0 compiler
  186.     Rita Reichl        - For correcting my bad english ;-)
  187.     Jim Rickman        - For reporting a bug
  188.  
  189. Date/--history--                                             Date/--history--
  190.  
  191.    NAME
  192.     history -- This is the development history of the Date module
  193.  
  194.    VERSION
  195.     $VER: Date 33.089 (30.11.1994)
  196.  
  197.    HISTORY
  198.     16.01.1994 -    Procedures: JulianLeapYear, GregorianLeapYear &
  199.             HeisLeapYear initiated.
  200.     22.01.1994 -    Procedures: JulianMonthDays, GregorianMonthDays,
  201.             HeisMonthDays, JulianYearDays, GregorianYearDays,
  202.             HeisYearDays, JulianDayDiff, GregorianDayDiff,
  203.             HeisDayDiff, JulianDaySmaller, GregorianDaySmaller,
  204.             HeisDaySmaller, JulianWeekday, GregorianWeekday,
  205.             HeisWeekday, JulianDaysBeforeWeekday,
  206.             GregorianDaysBeforeWeekday, HeisDaysBeforeWeekday,
  207.             JulianDaysAfterWeekday, GregorianDaysAfterWeekday,
  208.             HeisDaysAfterWeekday JulianDiffDate, FreeDate
  209.             initiated.
  210.             Types: Weekdays, Date, DatePtr initiated.
  211.             Vars of Gregorian reform initiated
  212.             (for changing to different countries)
  213.     23.01.1994 -    Procedures: JulianDiffDate finished,
  214.             GregorianDiffDate, HeisDiffDate, JYearToScaliger,
  215.             GYearToScaliger, HYearToScaliger, ScaligerYearToJ,
  216.             ScaligerYearToG, ScaligerYearToH, JSYearToJD,
  217.             GSYearToJD, HSYearToJD, JDtoMJD, MJDtoJD, JulianToJD,
  218.             GregorianToJD, HeisToJD, TimeToJD, JDToTime, FreeTime
  219.             initiated.
  220.             Types: Time, TimePtr initiated.
  221.     28.01.1994 -    Procedures: GregorianMoonAge, MoonMonthAge,
  222.             GregorianEaster initiated.
  223.     30.01.1994 -    Procedures: JulianDiffDate, GregorianDiffDate,
  224.             HeisDiffDate, JDtoTime, GregorianEaster edited
  225.             (changing return value from ptr to VAL variables).
  226.             Procedures: FreeDate, FreeTime deleted.
  227.             Types: Date, DatePtr, Time, TimePtr deleted (not
  228.             longer needed, because of the procedure changes).
  229.             Procedures: GregorianMoonAge, GregorianEaster changed
  230.             year parameter from CARDINAL to INTEGER (this is more
  231.             consistent to the rest of the library).
  232.             Bugs removed: GregorianWeekday, HeisWeekday
  233.             (before removing, the weekday for leapyears was
  234.             wrong)
  235.             Procedure: GregorianEaster finished.
  236.     30.01.1994 -    Ported to Oberon-2
  237.     31.01.1994 -    Compiled with Oberon-2 V3.11
  238.     12.02.1994 -    Procedures: TimeZoneFactor, LMT, TimeToSec, SecToTime
  239.             initiated.
  240.             Version-String installed :)
  241.     12.02.1994 -    Starting translation to SAS C 6.51
  242.             Date.h translated
  243.     13.02.1994 -    Continuation of C translation
  244.     17.02.1994 -    New Oberon-2 Port, because yesterday Daniel Armor
  245.             gives me a small hint about the SHORT command
  246.             (I did not know about this!)
  247.     17.02.1994 -    Small bug in Autodocs removed
  248.             making this text as Date/--history-- autodoc
  249.     17.02.1994 -    Continuation of C translation
  250.     18.02.1994 -    Finished with C translation
  251.     19.02.1994 -    C bugs removed (thanx to SAS for helping a C Lamer
  252.             like me!), some optimizations done too.
  253.     19.02.1994 -    Oberon-2 version compiled with V40.17 includes
  254.     21.02.1994 -    Starting to write Modula-II testmodule
  255.             Vars for the begining of Heis calculation initiated.
  256.             Fixed small bugs in GregorianWeekday, HeisWeekday,
  257.             TimeToSec, SecToTime
  258.             Return-value of LMT changed to LONGINT!
  259.             Converting testmodule to Oberon-2
  260.     22.02.1994 -    Converting testmodule to C
  261.     23.02.1994 -    I noticed, that I forgot the 3 functions
  262.             JulianWeek, GregorianWeek, HeisWeek
  263.     24.02.1994 -    Initiated the 3 forgotten functions
  264.     26.02.1994 -    Initiating new GregorianEastern with Gauß-algorithms
  265.             but ONLY for 1900-2099!
  266.     27.02.1994 -    Bug fixed in JulianWeekday
  267.             Bugs fixed in JulianDayDiff, GregorianDayDiff,
  268.             HeisDayDiff
  269.             JulianDayGreater, GregorianDayGreater,
  270.             HeisDayGreater Initiated.
  271.     02.03.1994 -    Small bug fixed in HeisdayDiff
  272.             Bugs from 27.02. fixed in Modula-II and Oberon-2
  273.             versions
  274.             I found the way to extend Gregorian Easter!
  275.             Small bug fixed in JulianWeek, GregorianWeek,
  276.             HeisWeek (~(M2) is not !(C))
  277.     05.03.1994 -    Some internal bugs removed
  278.             New internal procedures GregorianSB,
  279.             GregorianJHSB, GregorianJHStartSB!
  280.             Extending GregorianEaster :)
  281.     11.03.1994 -    Things from 05.03. done in Modula-II and Oberon
  282.     12.03.1994 -    If __SASC is defined autoinitalization instead of
  283.             _DateInit will be used!
  284.     13.03.1994 -    After studying the SAS C Manual again I decided to
  285.             check for __SASC_650 instead of __SASC because of
  286.             the available priorities!
  287.             Setting the priority of _DateInit for
  288.             autoinitalization to 600!
  289.     15.03.1994 -    Making Date as library
  290.     16.03.1994 -    Some work on the Autodocs was done
  291.             Eleminating OldGregorianEaster by comments
  292.             (ANSI: STOP bad standards like that there are NO
  293.              nested comments possible in C!!!)
  294.     19.03.1994 -    Some work on the Autodocs was done in the M2 Code
  295.     20.03.1994 -    Some work on the Autodocs was done in the Oberon Code
  296.     22.03.1994 -    In JDtoMJD, MJD to JD an L was added to the constant
  297.             In GregorianWeekday(), HeisWeekday(),
  298.             JulianDiffDate(), GregorianDiffDate(),
  299.             HeisDiffDate(), JDToTime() I have inserted
  300.             conversions (found with Borland C++ 4.0)
  301.     24.03.1994 -    Making SunOS4.1.3, SunOS5.3(Solaris2.3) &
  302.             RS6000 AIX3.2.? binaries with gcc
  303.             Eliminating nested commends by inserting a space
  304.             between / and * (I hate this ANSI C standard
  305.             feature for commends :(
  306.     27.03.1994 -    Adding library register assignments to the autodocs
  307.     03.04.1994 -    Small fixes for the SAS C++ Compiler
  308.             Small bug fixed in the M2 version of GregorianEaster
  309.     04.04.1994 -    Adding some 'static' keywords
  310.     10.04.1994 -    Changing from Shareware to Gift Ware ;-)
  311.     02.08.1994 -    Small fixes in the Autodocs (thanks to Rita Reichl
  312.             for correcting my bad english ;-)
  313.     11.08.1994 -    Again small fixes in the Autodocs!
  314.     13.11.1994 -    Small fix in JulianWeek(),GregorianWeek(),HeisWeek().
  315.             Thanks to Jim Rickman for reporting the bug!
  316.             Small changes in the Autodocs!
  317.     30.11.1994 -    Fix the bug from 13.11. in M2 and Oberon code.
  318.  
  319. Date/GregorianDayDiff                                   Date/GregorianDayDiff
  320.  
  321.    NAME
  322.     GregorianDayDiff -- Calculates the days between 2 dates. (V33)
  323.  
  324.    SYNOPSIS
  325.     days := GregorianDayDiff(day1,month1,year1,day2,month2,year2);
  326.  
  327.     PROCEDURE GregorianDayDiff(day1,month1 : SHORTCARD; year1 : INTEGER;
  328.         day2,month2 : SHORTCARD; year2 : INTEGER) : LONGINT;
  329.  
  330.    FUNCTION
  331.     GregorianDayDiff gives you back the number of days between
  332.     two specified dates.
  333.  
  334.    INPUTS
  335.     day1   - day of the first date
  336.     month1 - month of the first date
  337.     year1  - year of the first date
  338.     day2   - day of the second date
  339.     month2 - month of the second month
  340.     year2  - year of the second date
  341.  
  342.    RESULT
  343.     days - The number of days between the two dates
  344.         (positive if date1 <= date2).
  345.  
  346.    EXAMPLE
  347.     ...
  348.     days := GregorianDayDiff(18,9,1970,22,1,1994);
  349.     WriteString("Age of Kai Hofmann in days : ");
  350.     WriteInt(days,10); WriteLn;
  351.     ...
  352.  
  353.    NOTES
  354.     It is better only to use this function for years from -7 to 3200!
  355.  
  356.    BUGS
  357.     If you use on of the dates 5.10.1582 to 14.10.1582 you will get a
  358.     wrong output, because this days don't exist!
  359.  
  360.    SEE ALSO
  361.     JulianDayDiff(),HeisDayDiff(),GregorianDaySmaller(),
  362.     GregorianDayGreater(),GregorianMonthDays(),GregorianYearDays()
  363.  
  364. Date/GregorianDayGreater                             Date/GregorianDayGreater
  365.  
  366.    NAME
  367.     GregorianDayGreater -- Checks if date1 is greater than date2. (V33)
  368.  
  369.    SYNOPSIS
  370.     greater := GregorianDayGreater(day1,month1,year1,day2,month2,year2);
  371.  
  372.     PROCEDURE GregorianDayGreater(day1,month1 : SHORTCARD;
  373.         year1 : INTEGER; day2,month2 : SHORTCARD;
  374.         year2 : INTEGER) : BOOLEAN;
  375.  
  376.    FUNCTION
  377.     GregorianDayGreater test if date1 is greater than date2.
  378.  
  379.    INPUTS
  380.     day1   - day of the first date
  381.     month1 - month of the first date
  382.     year1  - year of the first date
  383.     day2   - day of the second date
  384.     month2 - month of the second month
  385.     year2  - year of the second date
  386.  
  387.    RESULT
  388.     greater - This is TRUE is date1 > date2 otherwise it's FALSE.
  389.  
  390.    EXAMPLE
  391.     ...
  392.     IF GregorianDayGreater(18,9,1970,22,1,1994) THEN
  393.       WriteString(">"); WriteLn;
  394.     ELSE
  395.       WriteString("<="); WriteLn;
  396.     END;
  397.     ...
  398.  
  399.    NOTES
  400.     It is better only to use this function for years from -7 to 3200!
  401.  
  402.    BUGS
  403.     No known bugs.
  404.  
  405.    SEE ALSO
  406.     JuliandayGreater(),HeisDayGreater()
  407.  
  408. Date/GregorianDaysAfterWeekday                 Date/GregorianDaysAfterWeekday
  409.  
  410.    NAME
  411.     GregorianDaysAfterWeekday -- Returns the diff to wday after. (V33)
  412.  
  413.    SYNOPSIS
  414.     days := GregorianDaysAfterWeekday(day,month,year,weekday);
  415.  
  416.     PROCEDURE GregorianDaysAfterWeekday(day,month : SHORTCARD;
  417.         year : INTEGER; weekday : Weekdays) : SHORTCARD;
  418.  
  419.    FUNCTION
  420.     Returns the days to the weekday after the specified date.
  421.     So if you specify the 22.1.1994 (Saturday) and Thursday
  422.     you get back 5!
  423.     If you specify the 22.1.1994 and Saturday you get back 0
  424.     (the same day)!
  425.  
  426.    INPUTS
  427.     day     - day of the date
  428.     month   - month of the date
  429.     year    - year of the date
  430.     weekday - weekday to search for building difference
  431.  
  432.    RESULT
  433.     days - The days after to the searched weekday.
  434.  
  435.    EXAMPLE
  436.     ...
  437.     days := GregorianDaysAfterWeekday(22,1,1994,Thursday);
  438.     ...
  439.  
  440.    NOTES
  441.     It is better to use this function only from -7 to 3200!
  442.  
  443.    BUGS
  444.     See GregorianWeekday()!
  445.  
  446.    SEE ALSO
  447.     JulianDaysAfterWeekday(),HeisDaysAfterWeekday(),GregorianWeekday()
  448.  
  449. Date/GregorianDaysBeforeWeekday               Date/GregorianDaysBeforeWeekday
  450.  
  451.    NAME
  452.     GregorianDaysBeforeWeekday -- Returns the diff to wday before. (V33)
  453.  
  454.    SYNOPSIS
  455.     days := GregorianDaysBeforeWeekday(day,month,year,weekday);
  456.  
  457.     PROCEDURE GregorianDaysBeforeWeekday(day,month : SHORTCARD;
  458.         year : INTEGER; weekday : Weekdays) : SHORTCARD;
  459.  
  460.    FUNCTION
  461.     Returns the days to the weekday before the specified date.
  462.     So if you specify the 22.1.1994 (Saturday) and Thursday
  463.     you get back 2!
  464.     If you specify the 22.1.1994 and Saturday you get back 0
  465.     (the same day)!
  466.  
  467.    INPUTS
  468.     day     - day of the date
  469.     month   - month of the date
  470.     year    - year of the date
  471.     weekday - weekday to search for building difference
  472.  
  473.    RESULT
  474.     days - The days back to the searched weekday (1-7)
  475.         If you get back 8 an error occurs!
  476.  
  477.    EXAMPLE
  478.     ...
  479.     days := GregorianDaysBeforeWeekday(22,1,1994,Thursday);
  480.     ...
  481.  
  482.    NOTES
  483.     It is better to use this function only from -7 to 3200!
  484.  
  485.    BUGS
  486.     See GregorianWeekday()!
  487.  
  488.    SEE ALSO
  489.     JulianDaysBeforeWeekday(),HeisDaysBeforeWeekday(),GregorianWeekday()
  490.  
  491. Date/GregorianDaySmaller                             Date/GregorianDaySmaller
  492.  
  493.    NAME
  494.     GregorianDaySmaller -- Checks if date1 is smaller than date2. (V33)
  495.  
  496.    SYNOPSIS
  497.     smaller := GregorianDaySmaller(day1,month1,year1,day2,month2,year2);
  498.  
  499.     PROCEDURE GregorianDaySmaller(day1,month1 : SHORTCARD;
  500.         year1 : INTEGER; day2,month2 : SHORTCARD;
  501.         year2 : INTEGER) : BOOLEAN;
  502.  
  503.    FUNCTION
  504.     GregorianDaySmaller test if date1 is smaller than date2.
  505.  
  506.    INPUTS
  507.     day1   - day of the first date
  508.     month1 - month of the first date
  509.     year1  - year of the first date
  510.     day2   - day of the second date
  511.     month2 - month of the second month
  512.     year2  - year of the second date
  513.  
  514.    RESULT
  515.     smaller - This is TRUE is date1 < date2 otherwise it's FALSE.
  516.  
  517.    EXAMPLE
  518.     ...
  519.     IF GregorianDaySmaller(18,9,1970,22,1,1994) THEN
  520.       WriteString("<"); WriteLn;
  521.     ELSE
  522.       WriteString(">="); WriteLn;
  523.     END;
  524.     ...
  525.  
  526.    NOTES
  527.     It is better only to use this function for years from -7 to 3200!
  528.  
  529.    BUGS
  530.     No known bugs.
  531.  
  532.    SEE ALSO
  533.     JulianDaySmaller(),HeisDaySmaller()
  534.  
  535. Date/GregorianDiffDate                                 Date/GregorianDiffDate
  536.  
  537.    NAME
  538.     GregorianDiffDate -- Returns the diff date to another date. (V33)
  539.  
  540.    SYNOPSIS
  541.     GregorianDiffDate(day,month,year,diffdays,dday,dmonth,dyear);
  542.  
  543.     PROCEDURE GregorianDiffDate(day,month : SHORTCARD;
  544.         year,days : INTEGER; VAR dday,dmonth : SHORTCARD;
  545.         VAR dyear : INTEGER);
  546.  
  547.    FUNCTION
  548.     Returns the date wich lies diffdays before/after the specified date.
  549.  
  550.    INPUTS
  551.     day      - day of the date
  552.     month    - month of the date
  553.     year     - year of the date
  554.     diffdays - difference to the date in days
  555.  
  556.    RESULT
  557.     dday   - Destination day
  558.     dmonth - Destination month
  559.     dyear  - Destination year
  560.  
  561.    EXAMPLE
  562.     ...
  563.     GregorianDiffDate(23,1,1994,7,dday,dmonth,dyear);
  564.     ...
  565.  
  566.    NOTES
  567.     It is better to use this function only from -7 to 3200!
  568.  
  569.    BUGS
  570.     unknown.
  571.  
  572.    SEE ALSO
  573.     GregorianDayDiff(),JulianDiffDate(),HeisDiffDate()
  574.  
  575. Date/GregorianEaster                                     Date/GregorianEaster
  576.  
  577.    NAME
  578.     GregorianEaster -- Returns the date of eastern in a year (V33)
  579.  
  580.    SYNOPSIS
  581.     GregorianEaster(year,dday,dmonth);
  582.  
  583.     PROCEDURE GregorianEaster(year : INTEGER;
  584.         VAR dday,dmonth : SHORTCARD);
  585.  
  586.    FUNCTION
  587.     Returns the date of eastern for a specified year.
  588.  
  589.    INPUTS
  590.     year  - eastern is calculated for this year
  591.  
  592.    RESULT
  593.     dday   - day of easter-Sunday
  594.     dmonth - month of easter-Sunday
  595.  
  596.    EXAMPLE
  597.     ...
  598.     GregorianEaster(1994,dday,dmonth);
  599.     ...
  600.  
  601.    NOTES
  602.     Use this only for 1900 to 2099!
  603.     Tested for 1977-1994! But this formula is from Gauß - so it must be
  604.     correct :)
  605.  
  606.    BUGS
  607.     None.
  608.  
  609.    SEE ALSO
  610.     GEP(),GregorianJHSB()
  611.  
  612. Date/GregorianLeapYear                                 Date/GregorianLeapYear
  613.  
  614.    NAME
  615.     GregorianLeapYear -- Checks if a year is a leap year. (V33)
  616.  
  617.    SYNOPSIS
  618.     leapyear := GregorianLeapYear(year);
  619.  
  620.     PROCEDURE GregorianLeapYear(year : INTEGER) : BOOLEAN;
  621.  
  622.    FUNCTION
  623.     GregorianLeapYear checks if a year is a leap year.
  624.     For years after 1582 all years devideable by 4 are leap years,
  625.     without years devideable by 100, but years devideable by 400
  626.     are leap years again!
  627.     For years before 1582 see JulianLeapYear().
  628.  
  629.    INPUTS
  630.     year - The year which should be checked (from -32768 to 32767)
  631.         I think only values from -7 to 3200 are valid, because of
  632.         the variant that was done on -8 by Augustus and other things!
  633.  
  634.    RESULT
  635.     leapyear - TRUE if the year is a leap year, otherwise false.
  636.  
  637.    EXAMPLE
  638.     ...
  639.     IF GregorianLeapYear(1994) THEN
  640.       WriteString("leap year!");
  641.     ELSE
  642.       WriteString("no leap year!");
  643.     END;
  644.     WriteLn;
  645.     ...
  646.  
  647.    NOTES
  648.     A year is 365.2425 days long!
  649.     Use this function only for values from -7 to 3199
  650.  
  651.    BUGS
  652.     No known bugs.
  653.  
  654.    SEE ALSO
  655.     JulianLeapYear(),HeisLeapYear()
  656.  
  657. Date/GregorianMonthDays                               Date/GregorianMonthDays
  658.  
  659.    NAME
  660.     GregorianMonthDays -- Gives back the number of days of a month. (V33)
  661.  
  662.    SYNOPSIS
  663.     days := GregorianMonthDays(month,year);
  664.  
  665.     PROCEDURE GregorianMonthDays(month : SHORTCARD;
  666.         year : INTEGER) : SHORTCARD;
  667.  
  668.    FUNCTION
  669.     GregorianMonthDays gives you back the number of days a month in
  670.     a specified year has.
  671.     For the year 1582 and the month 10 there are only 21 days,
  672.     because of the Gregorian-reform 10 days are delete from
  673.     the month (for more - look out for books about this!)
  674.  
  675.    INPUTS
  676.     month - The month from wich you want to get the number of days.
  677.     year  - The year in which the month is.
  678.  
  679.    RESULT
  680.     days - The number of days the month uses, or 0 if you use
  681.         a wrong month.
  682.  
  683.    EXAMPLE
  684.     ...
  685.     days := GregorianMonthDays(1,1994);
  686.     WriteString("Days of January 1994 : ");
  687.     WriteCard(days,2); WriteLn;
  688.     ...
  689.  
  690.    NOTES
  691.     Use this function only for years from -7 to 3199!
  692.  
  693.    BUGS
  694.     If the reform in a country is not in the same month an error will
  695.     occur!
  696.  
  697.    SEE ALSO
  698.     GregorianLeapYear(),JulianMonthDays(),HeisMonthDays()
  699.  
  700. Date/GregorianMoonAge                                   Date/GregorianMoonAge
  701.  
  702.    NAME
  703.     GregorianMoonAge -- Returns the age of the moon (V33)
  704.  
  705.    SYNOPSIS
  706.     ep := GregorianMoonAge(day,month,year);
  707.  
  708.     PROCEDURE GregorianMoonAge(day,month : SHORTCARD;
  709.         year : CARDINAL) : SHORTCARD;
  710.  
  711.    FUNCTION
  712.     Returns the age of the moon on a specified date.
  713.  
  714.    INPUTS
  715.     day   - For this day the age is calculated.
  716.     month - For this month the age is calculated.
  717.     year  - For this year the age is calculated.
  718.  
  719.    RESULT
  720.     ep - The age of the moon on the specified date.
  721.  
  722.    EXAMPLE
  723.     ...
  724.     ep := GregorianMoonAge(18,9,1994);
  725.     ...
  726.  
  727.    NOTES
  728.     Use this only for 1582 to 4100!
  729.     This is only a experimental version!
  730.  
  731.    BUGS
  732.     unknown.
  733.  
  734.    SEE ALSO
  735.     MoonMonthAge(),GregorianEP()
  736.  
  737. Date/GregorianToJD                                         Date/GregorianToJD
  738.  
  739.    NAME
  740.     GregorianToJD -- Returns the JD for a date. (V33)
  741.  
  742.    SYNOPSIS
  743.     jd := GregorianToJD(day,month,year);
  744.  
  745.     PROCEDURE GregorianToJD(day,month : SHORTCARD;
  746.         year : INTEGER) : LONGCARD;
  747.  
  748.    FUNCTION
  749.     Returns the JD for a Gregorian date.
  750.  
  751.    INPUTS
  752.     day      - day of the date to convert
  753.     month    - month of the date to convert
  754.     year     - year of the date to convert
  755.  
  756.    RESULT
  757.     jd - This is the JD
  758.  
  759.    EXAMPLE
  760.     ...
  761.     jd := GregorianToJD(23,1,1994);
  762.     ...
  763.  
  764.    NOTES
  765.     It is better to use this function only from -7 to 3200!
  766.  
  767.    BUGS
  768.     unknown.
  769.  
  770.    SEE ALSO
  771.     JulianToJD(),HeisToJD(),GSYearToJD(),GYearToScaliger(),
  772.     GregorianDayDiff()
  773.  
  774. Date/GregorianWeek                                         Date/GregorianWeek
  775.  
  776.    NAME
  777.     GregorianWeek -- Gets the weeknumber of a specified date. (V33)
  778.  
  779.    SYNOPSIS
  780.     weeknr := GregorianWeek(day,month,year);
  781.  
  782.     PROCEDURE GregorianWeek(day,month : SHORTCARD;
  783.         year : INTEGER) : SHORTCARD;
  784.  
  785.    FUNCTION
  786.     GregorianWeek gets the weeknumber for a specified date.
  787.  
  788.    INPUTS
  789.     day   - day of the date
  790.     month - month of the date
  791.     year  - year of the date
  792.  
  793.    RESULT
  794.     week - This is the number of the week the specified date lies in.
  795.         If the first day in a new year is a Friday, Saturday or
  796.         Sunday, this would be the last week of the last year!
  797.         If the 29.12. is a Monday, the 30.12. is a Monday or a Tuesday,
  798.         the 31.12. is a Monday, Tuesday or a Wednesday this is the
  799.         first week of the next year!
  800.  
  801.    EXAMPLE
  802.     ...
  803.     weeknr := GregorianWeek(4,10,1582);
  804.     ...
  805.  
  806.    NOTES
  807.     It is is better only to use this function for years from 0 to 3000!
  808.  
  809.    BUGS
  810.     For years < 0 errors could occur.
  811.  
  812.    SEE ALSO
  813.     JulianWeek(),HeisWeek(),GregorianDaySmaller(),GregorianWeekday(),
  814.     GregorianDayDiff()
  815.  
  816. Date/GregorianWeekday                                   Date/GregorianWeekday
  817.  
  818.    NAME
  819.     GregorianWeekday -- Gets the weekday of a specified date. (V33)
  820.  
  821.    SYNOPSIS
  822.     weekday := GregorianWeekday(day,month,year);
  823.  
  824.     PROCEDURE GregorianWeekday(day,month : SHORTCARD;
  825.         year : INTEGER) : Weekday;
  826.  
  827.    FUNCTION
  828.     GregorianWeekday gets the weekday for a specified date.
  829.  
  830.    INPUTS
  831.     day   - day of the date
  832.     month - month of the date
  833.     year  - year of the date
  834.  
  835.    RESULT
  836.     weekday - This result is of type:
  837.         Weekdays = (dayerr,Monday,Tuesday,Wednesday,Thursday,Friday,
  838.         Saturday,Sunday);
  839.         dayerr will show you, that an error occurs!
  840.  
  841.    EXAMPLE
  842.     ...
  843.     weekday := GregorianWeekday(22,1,1994);
  844.     IF weekday = dayerr THEN
  845.     ...
  846.     END;
  847.     ...
  848.  
  849.    NOTES
  850.     It is better only to use this function for years from -7 to 3200!
  851.     In this version dayerr will only occur for the 10 lost days :)
  852.  
  853.    BUGS
  854.     It's not possible to use years < 0 (for more see JulianWeekday()).
  855.  
  856.    SEE ALSO
  857.     JulianWeekday(),HeisWeekday(),GregorianDaySmaller(),
  858.     GregorianLeapYear()
  859.  
  860. Date/GregorianYearDays                                 Date/GregorianYearDays
  861.  
  862.    NAME
  863.     GregorianYearDays -- Gives back the number of days in a year. (V33)
  864.  
  865.    SYNOPSIS
  866.     days := GregorianYearDays(year);
  867.  
  868.     PROCEDURE GregorianYearDays(year : INTEGER) : CARDINAL;
  869.  
  870.    FUNCTION
  871.     GregorianYearDays gives you back the number of days in
  872.     a specified year.
  873.  
  874.    INPUTS
  875.     year  - The year in which to count the days.
  876.  
  877.    RESULT
  878.     days - The number of days the year uses.
  879.  
  880.    EXAMPLE
  881.     ...
  882.     days := GregorianYearDays(1994);
  883.     WriteString("Days of 1994 : ");
  884.     WriteCard(days,3); WriteLn;
  885.     ...
  886.  
  887.    NOTES
  888.     It is better only to use this function for years from -7 to 3199!
  889.  
  890.    BUGS
  891.     No known bugs.
  892.  
  893.    SEE ALSO
  894.     GregorianMonthDays(),JulianYearDays(),HeisYearDays()
  895.  
  896. Date/GSYearToJD                                               Date/GSYearToJD
  897.  
  898.    NAME
  899.     GSYearToJD -- Calcs the JD from a Scaliger year. (V33)
  900.  
  901.    SYNOPSIS
  902.     jd := GSYearToJD(syear);
  903.  
  904.     PROCEDURE GSYearToJD(syear : CARDINAL) : LONGCARD;
  905.  
  906.    FUNCTION
  907.     Returns the Julianday of a Scaliger year.
  908.  
  909.    INPUTS
  910.     syear     - Scaliger year
  911.  
  912.    RESULT
  913.     jd - The Julianday
  914.  
  915.    EXAMPLE
  916.     ...
  917.     jd := GSYearToJD(4800);
  918.     ...
  919.  
  920.    NOTES
  921.     It is better to use this function only from 4707 to 7981!
  922.  
  923.    BUGS
  924.     unknown.
  925.  
  926.    SEE ALSO
  927.     JSYearToJD(),HSYearToJD(),GregorianDayDiff(),ScaligerYearToG()
  928.  
  929. Date/GYearToScaliger                                     Date/GYearToScaliger
  930.  
  931.    NAME
  932.     GYearToScaliger -- Returns the year as Scaliger year. (V33)
  933.  
  934.    SYNOPSIS
  935.     syear := GYearToScaliger(year);
  936.  
  937.     PROCEDURE GYearToScaliger(year : INTEGER) : CARDINAL;
  938.  
  939.    FUNCTION
  940.     Returns the Scaliger year.
  941.  
  942.    INPUTS
  943.     year     - Gregorian year
  944.  
  945.    RESULT
  946.     syear - The Scaliger year
  947.  
  948.    EXAMPLE
  949.     ...
  950.     syear := GYearToScaliger(1994);
  951.     ...
  952.  
  953.    NOTES
  954.     It is better to use this function only from -7 to 3200!
  955.  
  956.    BUGS
  957.     unknown.
  958.  
  959.    SEE ALSO
  960.     JYearToScaliger(),HYearToScaliger()
  961.  
  962. Date/HeisDayDiff                                             Date/HeisDayDiff
  963.  
  964.    NAME
  965.     HeisDayDiff -- Calculates the days between 2 dates. (V33)
  966.  
  967.    SYNOPSIS
  968.     days := HeisDayDiff(day1,month1,year1,day2,month2,year2);
  969.  
  970.     PROCEDURE HeisDayDiff(day1,month1 : SHORTCARD; year1 : INTEGER;
  971.         day2,month2 : SHORTCARD; year2 : INTEGER) : LONGINT;
  972.  
  973.    FUNCTION
  974.     HeisDayDiff gives you back the number of days between
  975.     two specified dates.
  976.  
  977.    INPUTS
  978.     day1   - day of the first date
  979.     month1 - month of the first date
  980.     year1  - year of the first date
  981.     day2   - day of the second date
  982.     month2 - month of the second month
  983.     year2  - year of the second date
  984.  
  985.    RESULT
  986.     days - The number of days between the two dates
  987.         (positive if date1 <= date2).
  988.  
  989.    EXAMPLE
  990.     ...
  991.     days := HeisDayDiff(18,9,1970,22,1,1994);
  992.     WriteString("Age of Kai Hofmann in days : ");
  993.     WriteInt(days,10); WriteLn;
  994.     ...
  995.  
  996.    NOTES
  997.     It is better only to use this function for years from -7 to 8000!
  998.  
  999.    BUGS
  1000.     If you use on of the dates 5.10.1582 to 14.10.1582 you will get a
  1001.     wrong output, because this days don't exist!
  1002.  
  1003.    SEE ALSO
  1004.     JulianDayDiff(),GregorianDayDiff(),HeisDaySmaller(),HeisDayGreater(),
  1005.     HeisMonthDays(),HeisYearDays()
  1006.  
  1007. Date/HeisDayGreater                                       Date/HeisDayGreater
  1008.  
  1009.    NAME
  1010.     HeisDayGreater -- Checks if date1 is greater than date2. (V33)
  1011.  
  1012.    SYNOPSIS
  1013.     greater := HeisDayGreater(day1,month1,year1,day2,month2,year2);
  1014.  
  1015.     PROCEDURE HeisDayGreater(day1,month1 : SHORTCARD; year1 : INTEGER;
  1016.         day2,month2 : SHORTCARD; year2 : INTEGER) : BOOLEAN;
  1017.  
  1018.    FUNCTION
  1019.     HeisDayGreater test if date1 is greater than date2.
  1020.  
  1021.    INPUTS
  1022.     day1   - day of the first date
  1023.     month1 - month of the first date
  1024.     year1  - year of the first date
  1025.     day2   - day of the second date
  1026.     month2 - month of the second month
  1027.     year2  - year of the second date
  1028.  
  1029.    RESULT
  1030.     greater - This is TRUE is date1 > date2 otherwise it's FALSE.
  1031.  
  1032.    EXAMPLE
  1033.     ...
  1034.     IF HeisDayGreater(18,9,1970,22,1,1994) THEN
  1035.       WriteString(">"); WriteLn;
  1036.     ELSE
  1037.       WriteString("<="); WriteLn;
  1038.     END;
  1039.     ...
  1040.  
  1041.    NOTES
  1042.     It is better only to use this function for years from -7 to 8000!
  1043.  
  1044.    BUGS
  1045.     No known bugs.
  1046.  
  1047.    SEE ALSO
  1048.     JulianDayGreater(),GregorianDayGreater()
  1049.  
  1050. Date/HeisDaysAfterWeekday                           Date/HeisDaysAfterWeekday
  1051.  
  1052.    NAME
  1053.     HeisDaysAfterWeekday -- Returns the diff to the wday after. (V33)
  1054.  
  1055.    SYNOPSIS
  1056.     days := HeisDaysAfterWeekday(day,month,year,weekday);
  1057.  
  1058.     PROCEDURE HeisDaysAfterWeekday(day,month : SHORTCARD;
  1059.         year : INTEGER; weekday : Weekdays) : SHORTCARD;
  1060.  
  1061.    FUNCTION
  1062.     Returns the days to the weekday after the specified date.
  1063.     So if you specify the 22.1.1994 (Saturday) and Thursday
  1064.     you get back 5!
  1065.     If you specify the 22.1.1994 and Saturday you get back 0
  1066.     (the same day)!
  1067.  
  1068.    INPUTS
  1069.     day     - day of the date
  1070.     month   - month of the date
  1071.     year    - year of the date
  1072.     weekday - weekday to search for building difference
  1073.  
  1074.    RESULT
  1075.     days - The days after to the searched weekday.
  1076.  
  1077.    EXAMPLE
  1078.     ...
  1079.     days := HeisDaysAfterWeekday(22,1,1994,Thursday);
  1080.     ...
  1081.  
  1082.    NOTES
  1083.     It is better to use this function only from -7 to 8000!
  1084.  
  1085.    BUGS
  1086.     See HeisWeekday()!
  1087.  
  1088.    SEE ALSO
  1089.     JulianDaysAfterWeekday(),GregorianDaysAfterWeekday(),HeisWeekday()
  1090.  
  1091. Date/HeisDaysBeforeWeekday                         Date/HeisDaysBeforeWeekday
  1092.  
  1093.    NAME
  1094.     HeisDaysBeforeWeekday -- Returns the diff to wday before. (V33)
  1095.  
  1096.    SYNOPSIS
  1097.     days := HeisDaysBeforeWeekday(day,month,year,weekday);
  1098.  
  1099.     PROCEDURE HeisDaysBeforeWeekday(day,month : SHORTCARD;
  1100.         year : INTEGER; weekday : Weekdays) : SHORTCARD;
  1101.  
  1102.    FUNCTION
  1103.     Returns the days to the weekday before the specified date.
  1104.     So if you specify the 22.1.1994 (Saturday) and Thursday
  1105.     you get back 2!
  1106.     If you specify the 22.1.1994 and Saturday you get back 0
  1107.     (the same day)!
  1108.  
  1109.    INPUTS
  1110.     day     - day of the date
  1111.     month   - month of the date
  1112.     year    - year of the date
  1113.     weekday - weekday to search for building difference
  1114.  
  1115.    RESULT
  1116.     days - The days back to the searched weekday (1-7)
  1117.         If you get back 8 an error occurs!
  1118.  
  1119.    EXAMPLE
  1120.     ...
  1121.     days := HeisDaysBeforeWeekday(22,1,1994,Thursday);
  1122.     ...
  1123.  
  1124.    NOTES
  1125.     It is better to use this function only from -7 to 8000!
  1126.  
  1127.    BUGS
  1128.     See HeisWeekday()!
  1129.  
  1130.    SEE ALSO
  1131.     JulianDaysBeforeWeekday(),GregorianDaysBeforeWeekday(),HeisWeekday()
  1132.  
  1133. Date/HeisDaySmaller                                       Date/HeisDaySmaller
  1134.  
  1135.    NAME
  1136.     HeisDaySmaller -- Checks if date1 is smaller than date2. (V33)
  1137.  
  1138.    SYNOPSIS
  1139.     smaller := HeisDaySmaller(day1,month1,year1,day2,month2,year2);
  1140.  
  1141.     PROCEDURE HeisDaySmaller(day1,month1 : SHORTCARD; year1 : INTEGER;
  1142.         day2,month2 : SHORTCARD; year2 : INTEGER) : BOOLEAN;
  1143.  
  1144.    FUNCTION
  1145.     HeisDaySmaller test if date1 is smaller than date2.
  1146.  
  1147.    INPUTS
  1148.     day1   - day of the first date
  1149.     month1 - month of the first date
  1150.     year1  - year of the first date
  1151.     day2   - day of the second date
  1152.     month2 - month of the second month
  1153.     year2  - year of the second date
  1154.  
  1155.    RESULT
  1156.     smaller - This is TRUE is date1 < date2 otherwise it's FALSE.
  1157.  
  1158.    EXAMPLE
  1159.     ...
  1160.     IF HeisDaySmaller(18,9,1970,22,1,1994) THEN
  1161.       WriteString("<"); WriteLn;
  1162.     ELSE
  1163.       WriteString(">="); WriteLn;
  1164.     END;
  1165.     ...
  1166.  
  1167.    NOTES
  1168.     It is better only to use this function for years from -7 to 8000!
  1169.  
  1170.    BUGS
  1171.     No known bugs.
  1172.  
  1173.    SEE ALSO
  1174.     JulianDaySmaller(),GregorianDaySmaller()
  1175.  
  1176. Date/HeisDiffDate                                           Date/HeisDiffDate
  1177.  
  1178.    NAME
  1179.     HeisDiffDate -- Returns the date for a diff to another date. (V33)
  1180.  
  1181.    SYNOPSIS
  1182.     HeisDiffDate(day,month,year,diffdays,dday,dmonth,dyear);
  1183.  
  1184.     PROCEDURE HeisDiffDate(day,month : SHORTCARD; year,days : INTEGER;
  1185.          VAR dday,dmonth : SHORTCARD; VAR dyear : INTEGER);
  1186.  
  1187.    FUNCTION
  1188.     Returns the date wich lies diffdays before/after the specified date.
  1189.  
  1190.    INPUTS
  1191.     day      - day of the date
  1192.     month    - month of the date
  1193.     year     - year of the date
  1194.     diffdays - difference to the date in days
  1195.  
  1196.    RESULT
  1197.     dday   - Destination day
  1198.     dmonth - Destination month
  1199.     dyear  - Destination year
  1200.  
  1201.    EXAMPLE
  1202.     ...
  1203.     HeisDiffDate(23,1,1994,7,dday,dmonth,dyear);
  1204.     ...
  1205.  
  1206.    NOTES
  1207.     It is better to use this function only from -7 to 8000!
  1208.  
  1209.    BUGS
  1210.     unknown.
  1211.  
  1212.    SEE ALSO
  1213.     HeisDayDiff(),JulianDiffDate(),GregorianDiffDate()
  1214.  
  1215. Date/HeisLeapYear                                           Date/HeisLeapYear
  1216.  
  1217.    NAME
  1218.     HeisLeapYear -- Checks if a year is a leap year. (V33)
  1219.  
  1220.    SYNOPSIS
  1221.     leapyear := HeisLeapYear(year);
  1222.  
  1223.     PROCEDURE HeisLeapYear(year : INTEGER) : BOOLEAN;
  1224.  
  1225.    FUNCTION
  1226.     HeisLeapYear checks if a year is a leap year.
  1227.     For years after 1582 see GregorianLeapYear(),
  1228.     The correction from N. Heis says, that all years devideable by
  1229.     3200 are no longer leap years!
  1230.     For years before 1582 see JulianLeapYear
  1231.  
  1232.    INPUTS
  1233.     year - The year which should be checked (from -32768 to 32767)
  1234.         I think only values from -7 to 8000 are valid, because of
  1235.         the variant that was done on -8 by Augustus and other things!
  1236.  
  1237.    RESULT
  1238.     leapyear - TRUE if the year is a leap year, otherwise false.
  1239.  
  1240.    EXAMPLE
  1241.     ...
  1242.     IF HeisLeapYear(1994) THEN
  1243.       WriteString("leap year!");
  1244.     ELSE
  1245.       WriteString("no leap year!");
  1246.     END;
  1247.     WriteLn;
  1248.     ...
  1249.  
  1250.    NOTES
  1251.     A year is now 365.2421875 days!
  1252.     Use this function only for values from -7 to 8000!
  1253.  
  1254.    BUGS
  1255.     No known bugs.
  1256.  
  1257.    SEE ALSO
  1258.     JulianLeapYear(),GregorianLeapYear()
  1259.  
  1260. Date/HeisMonthDays                                         Date/HeisMonthDays
  1261.  
  1262.    NAME
  1263.     HeisMonthDays -- Gives back the number of days of a month. (V33)
  1264.  
  1265.    SYNOPSIS
  1266.     days := HeisMonthDays(month,year);
  1267.  
  1268.     PROCEDURE HeisMonthDays(month : SHORTCARD;
  1269.         year : INTEGER) : SHORTCARD;
  1270.  
  1271.    FUNCTION
  1272.     HeisMonthDays gives you back the number of days a month in
  1273.     a specified year has.
  1274.     For the year 1582 and the month 10 there are only 21 days,
  1275.     because of the Gregorian-reform 10 days are delete from
  1276.     the month (for more - look out for books about this!)
  1277.  
  1278.    INPUTS
  1279.     month - The month from wich you want to get the number of days.
  1280.     year  - The year in which the month is.
  1281.  
  1282.    RESULT
  1283.     days - The number of days the month uses, or 0 if you use
  1284.         a wrong month.
  1285.  
  1286.    EXAMPLE
  1287.     ...
  1288.     days := HeisMonthDays(1,1994);
  1289.     WriteString("Days of January 1994 : ");
  1290.     WriteCard(days,2); WriteLn;
  1291.     ...
  1292.  
  1293.    NOTES
  1294.     Use this function only for years from -7 to 8000!
  1295.  
  1296.    BUGS
  1297.     See GregorianMonthDays!
  1298.  
  1299.    SEE ALSO
  1300.     HeisLeapYear(),JulianMonthDays(),GregorianMonthDays()
  1301.  
  1302. Date/HeisToJD                                                   Date/HeisToJD
  1303.  
  1304.    NAME
  1305.     HeisToJD -- Returns the JD for a date. (V33)
  1306.  
  1307.    SYNOPSIS
  1308.     jd := HeisToJD(day,month,year);
  1309.  
  1310.     PROCEDURE HeisToJD(day,month : SHORTCARD;
  1311.         year : INTEGER) : LONGCARD;
  1312.  
  1313.    FUNCTION
  1314.     Returns the JD for a Heis date.
  1315.  
  1316.    INPUTS
  1317.     day      - day of the date to convert
  1318.     month    - month of the date to convert
  1319.     year     - year of the date to convert
  1320.  
  1321.    RESULT
  1322.     jd - This is the JD
  1323.  
  1324.    EXAMPLE
  1325.     ...
  1326.     jd := HeisToJD(23,1,1994);
  1327.     ...
  1328.  
  1329.    NOTES
  1330.     It is better to use this function only from -7 to 3268!
  1331.  
  1332.    BUGS
  1333.     unknown.
  1334.  
  1335.    SEE ALSO
  1336.     JulianToJD(),GregorianToJD(),HSYearToJD(),HYearToScaliger(),
  1337.     HeisDayDiff()
  1338.  
  1339. Date/HeisWeek                                                   Date/HeisWeek
  1340.  
  1341.    NAME
  1342.     HeisWeek -- Gets the weeknumber of a specified date. (V33)
  1343.  
  1344.    SYNOPSIS
  1345.     weeknr := HeisWeek(day,month,year);
  1346.  
  1347.     PROCEDURE HeisWeek(day,month : SHORTCARD;
  1348.         year : INTEGER) : SHORTCARD;
  1349.  
  1350.    FUNCTION
  1351.     HeisWeek gets the weeknumber for a specified date.
  1352.  
  1353.    INPUTS
  1354.     day   - day of the date
  1355.     month - month of the date
  1356.     year  - year of the date
  1357.  
  1358.    RESULT
  1359.     week - This is the number of the week the specified date lies in.
  1360.         If the first day in a new year is a Friday, Saturday or
  1361.         Sunday, this would be the last week of the last year!
  1362.         If the 29.12. is a Monday, the 30.12. is a Monday or a Tuesday,
  1363.         the 31.12. is a Monday, Tuesday or a Wednesday this is the
  1364.         first week of the next year!
  1365.  
  1366.    EXAMPLE
  1367.     ...
  1368.     weeknr := HeisWeek(4,10,1582);
  1369.     ...
  1370.  
  1371.    NOTES
  1372.     It is is better only to use this function for years from 0 to 8000!
  1373.  
  1374.    BUGS
  1375.     For years < 0 errors could occur.
  1376.  
  1377.    SEE ALSO
  1378.     JulianWeek(),GregorianWeek(),HeisDayDiff(),HeisDaySmaller(),
  1379.     HeisWeekday()
  1380.  
  1381. Date/HeisWeekday                                             Date/HeisWeekday
  1382.  
  1383.    NAME
  1384.     HeisWeekday -- Gets the weekday of a specified date. (V33)
  1385.  
  1386.    SYNOPSIS
  1387.     weekday := HeisWeekday(day,month,year);
  1388.  
  1389.     PROCEDURE HeisWeekday(day,month : SHORTCARD;
  1390.         year : INTEGER) : Weekday;
  1391.  
  1392.    FUNCTION
  1393.     HeisWeekday gets the weekday for a specified date.
  1394.  
  1395.    INPUTS
  1396.     day   - day of the date
  1397.     month - month of the date
  1398.     year  - year of the date
  1399.  
  1400.    RESULT
  1401.     weekday - This result is of type:
  1402.         Weekdays = (dayerr,Monday,Tuesday,Wednesday,Thursday,Friday,
  1403.         Saturday,Sunday);
  1404.         dayerr will show you, that an error occurs!
  1405.  
  1406.    EXAMPLE
  1407.     ...
  1408.     weekday := HeisWeekday(22,1,1994);
  1409.     IF weekday = dayerr THEN
  1410.     ...
  1411.     END;
  1412.     ...
  1413.  
  1414.    NOTES
  1415.     It is better only to use this function for years from -7 to 8000!
  1416.     In this version dayerr will only occur for the 10 lost days :)
  1417.  
  1418.    BUGS
  1419.     It is not possible to use year < 0 (see JulianWeekday() for more).
  1420.  
  1421.    SEE ALSO
  1422.     JulianWeekday(),GregorianWeekday(),HeisDaySmaller(),HeisLeapYear(),
  1423.     HeisDayDiff()
  1424.  
  1425. Date/HeisYearDays                                           Date/HeisYearDays
  1426.  
  1427.    NAME
  1428.     HeisYearDays -- Gives back the number of days in a year. (V33)
  1429.  
  1430.    SYNOPSIS
  1431.     days := HeisYearDays(year);
  1432.  
  1433.     PROCEDURE HeisYearDays(year : INTEGER) : CARDINAL;
  1434.  
  1435.    FUNCTION
  1436.     HeisYearDays gives you back the number of days in
  1437.     a specified year.
  1438.  
  1439.    INPUTS
  1440.     year  - The year in which to count the days.
  1441.  
  1442.    RESULT
  1443.     days - The number of days the year uses.
  1444.  
  1445.    EXAMPLE
  1446.     ...
  1447.     days := HeisYearDays(1994);
  1448.     WriteString("Days of 1994 : ");
  1449.     WriteCard(days,3); WriteLn;
  1450.     ...
  1451.  
  1452.    NOTES
  1453.     It is better only to use this function for years from -7 to 8000!
  1454.  
  1455.    BUGS
  1456.     No known bugs.
  1457.  
  1458.    SEE ALSO
  1459.     HeisMonthDays(),JulianYearDays(),GregorianYearDays()
  1460.  
  1461. Date/HSYearToJD                                               Date/HSYearToJD
  1462.  
  1463.    NAME
  1464.     HSYearToJD -- Calcs the JD from a Scaliger year. (V33)
  1465.  
  1466.    SYNOPSIS
  1467.     jd := HSYearToJD(syear);
  1468.  
  1469.     PROCEDURE HSYearToJD(syear : CARDINAL) : LONGCARD;
  1470.  
  1471.    FUNCTION
  1472.     Returns the Julianday of a Scaliger year.
  1473.  
  1474.    INPUTS
  1475.     syear     - Scaliger year
  1476.  
  1477.    RESULT
  1478.     jd - The Julianday
  1479.  
  1480.    EXAMPLE
  1481.     ...
  1482.     jd := HSYearToJD(6700);
  1483.     ...
  1484.  
  1485.    NOTES
  1486.     It is better to use this function only from 4707 to 7981!
  1487.     In this version only GSYearToJD() is called, because the
  1488.     Scaliger period is only valid to 3268
  1489.  
  1490.    BUGS
  1491.     unknown.
  1492.  
  1493.    SEE ALSO
  1494.     JSYearToJD(),GSYearToJD()
  1495.  
  1496. Date/HYearToScaliger                                     Date/HYearToScaliger
  1497.  
  1498.    NAME
  1499.     HYearToScaliger -- Returns the year as Scaliger year. (V33)
  1500.  
  1501.    SYNOPSIS
  1502.     syear := HYearToScaliger(year);
  1503.  
  1504.     PROCEDURE HYearToScaliger(year : INTEGER) : CARDINAL;
  1505.  
  1506.    FUNCTION
  1507.     Returns the Scaliger year.
  1508.  
  1509.    INPUTS
  1510.     year     - Heis year
  1511.  
  1512.    RESULT
  1513.     syear - The Scaliger year
  1514.  
  1515.    EXAMPLE
  1516.     ...
  1517.     syear := HYearToScaliger(1994);
  1518.     ...
  1519.  
  1520.    NOTES
  1521.     It is better to use this function only from -7 to 8000!
  1522.  
  1523.    BUGS
  1524.     The Scaliger period is defined to 3268!!!.
  1525.  
  1526.    SEE ALSO
  1527.     JYearToScaliger(),GYearToScliger()
  1528.  
  1529. Date/JDtoMJD                                                     Date/JDtoMJD
  1530.  
  1531.    NAME
  1532.     JDtoMJD -- Switches from JD to MJD. (V33)
  1533.  
  1534.    SYNOPSIS
  1535.     mjd := JDtoMJD(jd);
  1536.  
  1537.     PROCEDURE JDtoMJD(jd : LONGCARD) : LONGCARD;
  1538.  
  1539.    FUNCTION
  1540.     Returns the Modified Julianday of a Julianday.
  1541.  
  1542.    INPUTS
  1543.     jd - Julianday
  1544.  
  1545.    RESULT
  1546.     mjd - The Modified Julianday
  1547.  
  1548.    EXAMPLE
  1549.     ...
  1550.     mjd := JDtoMJD(2449354);
  1551.     ...
  1552.  
  1553.    NOTES
  1554.     none
  1555.  
  1556.    BUGS
  1557.     Only use this function for jd > 2400001, because mjd is only
  1558.     defined for this, otherwise system will crash!
  1559.  
  1560.    SEE ALSO
  1561.     MJDtoJD()
  1562.  
  1563. Date/JDToTime                                                   Date/JDToTime
  1564.  
  1565.    NAME
  1566.     JDToTime -- Returns the real time for a JD time. (V33)
  1567.  
  1568.    SYNOPSIS
  1569.     JDToTime(jd,rhour,rmin,rsec);
  1570.  
  1571.     PROCEDURE JDToTime(jd : REAL; VAR rhour,rmin,rsec : SHORTCARD);
  1572.  
  1573.    FUNCTION
  1574.     Returns the real time for a JD time.
  1575.  
  1576.    INPUTS
  1577.     jd - JD time
  1578.  
  1579.    RESULT
  1580.     rhour - 24 hour real time
  1581.     rmin  - real minutes
  1582.     rsec  - real seconds
  1583.  
  1584.    EXAMPLE
  1585.     ...
  1586.     JDToTime(0.76543,rhour,rmin,rsec);
  1587.     ...
  1588.  
  1589.    NOTES
  1590.     none.
  1591.  
  1592.    BUGS
  1593.     If jd is > 0 (including days) there will be occur arithmetic bugs!
  1594.  
  1595.    SEE ALSO
  1596.     TimeToJD()
  1597.  
  1598. Date/JSYearToJD                                               Date/JSYearToJD
  1599.  
  1600.    NAME
  1601.     JSYearToJD -- Calcs the JD from a Scaliger year. (V33)
  1602.  
  1603.    SYNOPSIS
  1604.     jd := JSYearToJD(syear);
  1605.  
  1606.     PROCEDURE JSYearToJD(syear : CARDINAL) : LONGCARD;
  1607.  
  1608.    FUNCTION
  1609.     Returns the Julianday of a Scaliger year.
  1610.  
  1611.    INPUTS
  1612.     syear     - Scaliger year
  1613.  
  1614.    RESULT
  1615.     jd - The Julianday
  1616.  
  1617.    EXAMPLE
  1618.     ...
  1619.     jd := JSYearToJD(4800);
  1620.     ...
  1621.  
  1622.    NOTES
  1623.     It is better to use this function only from 4707 to 6295!
  1624.  
  1625.    BUGS
  1626.     unknown.
  1627.  
  1628.    SEE ALSO
  1629.     GSYearToJD(),HSYearToJD()
  1630.  
  1631. Date/JulianDayDiff                                         Date/JulianDayDiff
  1632.  
  1633.    NAME
  1634.     JulianDayDiff -- Calculates the days between 2 dates. (V33)
  1635.  
  1636.    SYNOPSIS
  1637.     days := JulianDayDiff(day1,month1,year1,day2,month2,year2);
  1638.  
  1639.     PROCEDURE JulianDayDiff(day1,month1 : SHORTCARD; year1 : INTEGER;
  1640.         day2,month2 : SHORTCARD; year2 : INTEGER) : LONGINT;
  1641.  
  1642.    FUNCTION
  1643.     JulianDayDiff gives you back the number of days between
  1644.     two specified dates.
  1645.  
  1646.    INPUTS
  1647.     day1   - day of the first date
  1648.     month1 - month of the first date
  1649.     year1  - year of the first date
  1650.     day2   - day of the second date
  1651.     month2 - month of the second month
  1652.     year2  - year of the second date
  1653.  
  1654.    RESULT
  1655.     days - The number of days between the two dates
  1656.         (positive if date1 <= date2).
  1657.  
  1658.    EXAMPLE
  1659.     ...
  1660.     days := JulianDayDiff(18,9,1970,22,1,1994);
  1661.     WriteString("Age of Kai Hofmann in days : ");
  1662.     WriteInt(days,10); WriteLn;
  1663.     ...
  1664.  
  1665.    NOTES
  1666.     It is better only to use this function for years from -7 to 1582!
  1667.  
  1668.    BUGS
  1669.     No known bugs.
  1670.  
  1671.    SEE ALSO
  1672.     GregorianDayDiff(),HeisDayDiff(),JulianMonthDays(),JulianYearDays()
  1673.  
  1674. Date/JulianDayGreater                                   Date/JulianDayGreater
  1675.  
  1676.    NAME
  1677.     JulianDayGreater -- Checks if date1 is greater than date2. (V33)
  1678.  
  1679.    SYNOPSIS
  1680.     greater := JulianDayGreater(day1,month1,year1,day2,month2,year2);
  1681.  
  1682.     PROCEDURE JulianDayGreater(day1,month1 : SHORTCARD; year1 : INTEGER;
  1683.         day2,month2 : SHORTCARD; year2 : INTEGER) : BOOLEAN;
  1684.  
  1685.    FUNCTION
  1686.     JulianDayGreater test if date1 is greater than date2.
  1687.  
  1688.    INPUTS
  1689.     day1   - day of the first date
  1690.     month1 - month of the first date
  1691.     year1  - year of the first date
  1692.     day2   - day of the second date
  1693.     month2 - month of the second month
  1694.     year2  - year of the second date
  1695.  
  1696.    RESULT
  1697.     greater - This is TRUE is date1 > date2 otherwise it's FALSE.
  1698.  
  1699.    EXAMPLE
  1700.     ...
  1701.     IF JulianDayGreater(18,9,1970,22,1,1994) THEN
  1702.       WriteString(">"); WriteLn;
  1703.     ELSE
  1704.       WriteString("<="); WriteLn;
  1705.     END;
  1706.     ...
  1707.  
  1708.    NOTES
  1709.     It is better only to use this function for years from -7 to 1582!
  1710.  
  1711.    BUGS
  1712.     No known bugs.
  1713.  
  1714.    SEE ALSO
  1715.     GregorianDayGreater(),HeisDayGreater()
  1716.  
  1717. Date/JulianDaysAfterWeekday                       Date/JulianDaysAfterWeekday
  1718.  
  1719.    NAME
  1720.     JulianDaysAfterWeekday -- Returns the diff to the wday after. (V33)
  1721.  
  1722.    SYNOPSIS
  1723.     days := JulianDaysAfterWeekday(day,month,year,weekday);
  1724.  
  1725.     PROCEDURE JulianDaysAfterWeekday(day,month : SHORTCARD;
  1726.         year : INTEGER; weekday : Weekdays) : SHORTCARD;
  1727.  
  1728.    FUNCTION
  1729.     Returns the days to the weekday after the specified date.
  1730.     So if you specify the 22.1.1994 (Saturday) and Thursday
  1731.     you get back 5!
  1732.     If you specify the 22.1.1994 and Saturday you get back 0
  1733.     (the same day)!
  1734.  
  1735.    INPUTS
  1736.     day     - day of the date
  1737.     month   - month of the date
  1738.     year    - year of the date
  1739.     weekday - weekday to search for building difference
  1740.  
  1741.    RESULT
  1742.     days - The days after to the searched weekday.
  1743.  
  1744.    EXAMPLE
  1745.     ...
  1746.     days := JulianDaysAfterWeekday(22,1,1994,Thursday);
  1747.     ...
  1748.  
  1749.    NOTES
  1750.     It is better to use this function only from -7 to 1582!
  1751.  
  1752.    BUGS
  1753.     See JulianWeekday()!
  1754.  
  1755.    SEE ALSO
  1756.     GregorianDaysAfterWeekday(),HeisDaysAfterWeekday(),JulianWeekday()
  1757.  
  1758. Date/JulianDaysBeforeWeekday                     Date/JulianDaysBeforeWeekday
  1759.  
  1760.    NAME
  1761.     JulianDaysBeforeWeekday -- Returns the diff to the wday before. (V33)
  1762.  
  1763.    SYNOPSIS
  1764.     days := JulianDaysBeforeWeekday(day,month,year,weekday);
  1765.  
  1766.     PROCEDURE JulianDaysBeforeWeekday(day,month : SHORTCARD;
  1767.         year : INTEGER; weekday : Weekdays) : SHORTCARD;
  1768.  
  1769.    FUNCTION
  1770.     Returns the days to the weekday before the specified date.
  1771.     So if you specify the 22.1.1994 (Saturday) and Thursday
  1772.     you get back 2!
  1773.     If you specify the 22.1.1994 and Saturday you get back 0
  1774.     (the same day)!
  1775.  
  1776.    INPUTS
  1777.     day     - day of the date
  1778.     month   - month of the date
  1779.     year    - year of the date
  1780.     weekday - weekday to search for building difference
  1781.  
  1782.    RESULT
  1783.     days - The days back to the searched weekday (0-6)
  1784.         If you get back 8 an error occurs!
  1785.  
  1786.    EXAMPLE
  1787.     ...
  1788.     days := JulianDaysBeforeWeekday(22,1,1994,Thursday);
  1789.     ...
  1790.  
  1791.    NOTES
  1792.     It is better to use this function only from -7 to 1582!
  1793.  
  1794.    BUGS
  1795.     See JulianWeekday()!
  1796.  
  1797.    SEE ALSO
  1798.     GregorianDaysBeforeWeekday(),HeisDaysBeforeWeekday(),JulianWeekday()
  1799.  
  1800. Date/JulianDaySmaller                                   Date/JulianDaySmaller
  1801.  
  1802.    NAME
  1803.     JulianDaySmaller -- Checks if date1 is smaller than date2. (V33)
  1804.  
  1805.    SYNOPSIS
  1806.     smaller := JulianDaySmaller(day1,month1,year1,day2,month2,year2);
  1807.  
  1808.     PROCEDURE JulianDaySmaller(day1,month1 : SHORTCARD; year1 : INTEGER;
  1809.         day2,month2 : SHORTCARD; year2 : INTEGER) : BOOLEAN;
  1810.  
  1811.    FUNCTION
  1812.     JulianDaySmaller test if date1 is smaller than date2.
  1813.  
  1814.    INPUTS
  1815.     day1   - day of the first date
  1816.     month1 - month of the first date
  1817.     year1  - year of the first date
  1818.     day2   - day of the second date
  1819.     month2 - month of the second month
  1820.     year2  - year of the second date
  1821.  
  1822.    RESULT
  1823.     smaller - This is TRUE is date1 < date2 otherwise it's FALSE.
  1824.  
  1825.    EXAMPLE
  1826.     ...
  1827.     IF JulianDaySmaller(18,9,1970,22,1,1994) THEN
  1828.       WriteString("<"); WriteLn;
  1829.     ELSE
  1830.       WriteString(">="); WriteLn;
  1831.     END;
  1832.     ...
  1833.  
  1834.    NOTES
  1835.     It is better only to use this function for years from -7 to 1582!
  1836.  
  1837.    BUGS
  1838.     No known bugs.
  1839.  
  1840.    SEE ALSO
  1841.     GregorianDaySmaller(),HeisDaySmaller()
  1842.  
  1843. Date/JulianDiffDate                                       Date/JulianDiffDate
  1844.  
  1845.    NAME
  1846.     JulianDiffDate -- Returns the date for a diff to another date. (V33)
  1847.  
  1848.    SYNOPSIS
  1849.     JulianDiffDate(day,month,year,diffdays,dday,dmonth,dyear);
  1850.  
  1851.     PROCEDURE JulianDiffDate(day,month : SHORTCARD; year,days : INTEGER;
  1852.         VAR dday,dmonth : SHORTCARD; VAR dyear : INTEGER);
  1853.  
  1854.    FUNCTION
  1855.     Returns the date wich lies diffdays before/after the specified date.
  1856.  
  1857.    INPUTS
  1858.     day      - day of the date
  1859.     month    - month of the date
  1860.     year     - year of the date
  1861.     diffdays - difference to the date in days
  1862.  
  1863.    RESULT
  1864.     dday   - Destination day
  1865.     dmonth - Destination month
  1866.     dyear  - Destination year
  1867.  
  1868.    EXAMPLE
  1869.     ...
  1870.     JulianDiffDate(23,1,1994,7,dday,dmonth,dyear);
  1871.     ...
  1872.  
  1873.    NOTES
  1874.     It is better to use this function only from -7 to 1582!
  1875.  
  1876.    BUGS
  1877.     unknown.
  1878.  
  1879.    SEE ALSO
  1880.     GregorianDiffDate(),HeisDiffDate(),JulianDayDiff()
  1881.  
  1882. Date/JulianLeapYear                                       Date/JulianLeapYear
  1883.  
  1884.    NAME
  1885.     JulianLeapYear -- Checks if a year is a leap year. (V33)
  1886.  
  1887.    SYNOPSIS
  1888.     leapyear := JulianLeapYear(year);
  1889.  
  1890.     PROCEDURE JulianLeapYear(year : INTEGER) : BOOLEAN;
  1891.  
  1892.    FUNCTION
  1893.     JulianLeapYear checks if a year is a leap year in the julian calendar
  1894.     For years after Chr. it checks if the year is devideable by 4.
  1895.     For years before Chr. a leap year must have a modulo 4 value of 1
  1896.  
  1897.    INPUTS
  1898.     year - The year which should be checked (from -32768 to 32767)
  1899.         I think only values from -7 to 1582 are valid, because of
  1900.         the variant that was done on -8 by Augustus and other things!
  1901.  
  1902.    RESULT
  1903.     leapyear - TRUE if the year is a leap year, otherwise false.
  1904.  
  1905.    EXAMPLE
  1906.     ...
  1907.     IF JulianLeapYear(1994) THEN
  1908.       WriteString("leap year!");
  1909.     ELSE
  1910.       WriteString("no leap year!");
  1911.     END;
  1912.     WriteLn;
  1913.     ...
  1914.  
  1915.    NOTES
  1916.     A year is 365.25 days long!
  1917.     Use this function only for values from -7 to 1582!
  1918.  
  1919.    BUGS
  1920.     No known bugs.
  1921.  
  1922.    SEE ALSO
  1923.     GregorianLeapYear(),HeisLeapYear()
  1924.  
  1925. Date/JulianMonthDays                                     Date/JulianMonthDays
  1926.  
  1927.    NAME
  1928.     JulianMonthDays -- Gives back the number of days of a month. (V33)
  1929.  
  1930.    SYNOPSIS
  1931.     days := JulianMonthDays(month,year);
  1932.  
  1933.     PROCEDURE JulianMonthDays(month : SHORTCARD;
  1934.         year : INTEGER) : SHORTCARD;
  1935.  
  1936.    FUNCTION
  1937.     JulianMonthDays gives you back the number of days a month in
  1938.     a specified year has.
  1939.  
  1940.    INPUTS
  1941.     month - The month from wich you want to get the number of days.
  1942.     year  - The year in which the month is.
  1943.  
  1944.    RESULT
  1945.     days - The number of days the month uses, or 0 if you use
  1946.         a wrong month.
  1947.  
  1948.    EXAMPLE
  1949.     ...
  1950.     days := JulianMonthDays(1,1994);
  1951.     WriteString("Days of January 1994 : ");
  1952.     WriteCard(days,2); WriteLn;
  1953.     ...
  1954.  
  1955.    NOTES
  1956.     It is better only to use this function for years from -7 to 09.1582!
  1957.  
  1958.    BUGS
  1959.     No known bugs.
  1960.  
  1961.    SEE ALSO
  1962.     JulianLeapYear(),GregorianMonthDays(),HeisMonthDays()
  1963.  
  1964. Date/JulianToJD                                               Date/JulianToJD
  1965.  
  1966.    NAME
  1967.     JulianToJD -- Returns the JD for a date. (V33)
  1968.  
  1969.    SYNOPSIS
  1970.     jd := JulianToJD(day,month,year);
  1971.  
  1972.     PROCEDURE JulianToJD(day,month : SHORTCARD;
  1973.         year : INTEGER) : LONGCARD;
  1974.  
  1975.    FUNCTION
  1976.     Returns the JD for a Julian date.
  1977.  
  1978.    INPUTS
  1979.     day      - day of the date to convert
  1980.     month    - month of the date to convert
  1981.     year     - year of the date to convert
  1982.  
  1983.    RESULT
  1984.     jd - This is the JD
  1985.  
  1986.    EXAMPLE
  1987.     ...
  1988.     jd := JulianToJD(23,1,1994);
  1989.     ...
  1990.  
  1991.    NOTES
  1992.     It is better to use this function only from -7 to 1582!
  1993.  
  1994.    BUGS
  1995.     unknown.
  1996.  
  1997.    SEE ALSO
  1998.     GregorianToJD(),HeisToJD(),JSYearToJD(),JYearToScaliger(),
  1999.     JulianDayDiff()
  2000.  
  2001. Date/JulianWeek                                               Date/JulianWeek
  2002.  
  2003.    NAME
  2004.     JulianWeek -- Gets the weeknumber of a specified date. (V33)
  2005.  
  2006.    SYNOPSIS
  2007.     weeknr := JulianWeek(day,month,year);
  2008.  
  2009.     PROCEDURE JulianWeek(day,month : SHORTCARD;
  2010.         year : INTEGER) : SHORTCARD;
  2011.  
  2012.    FUNCTION
  2013.     JulianWeek gets the weeknumber for a specified date.
  2014.  
  2015.    INPUTS
  2016.     day   - day of the date
  2017.     month - month of the date
  2018.     year  - year of the date
  2019.  
  2020.    RESULT
  2021.     week - This is the number of the week the specified date lies in.
  2022.         If the first day in a new year is a Friday, Saturday or
  2023.         Sunday, this would be the last week of the last year!
  2024.         If the 29.12. is a Monday, the 30.12. is a Monday or a Tuesday,
  2025.         the 31.12. is a Monday, Tuesday or a Wednesday this is the
  2026.         first week of the next year!
  2027.  
  2028.    EXAMPLE
  2029.     ...
  2030.     weeknr := JulianWeek(4,10,1582);
  2031.     ...
  2032.  
  2033.    NOTES
  2034.     It is is better only to use this function for years from 0 to 1582!
  2035.  
  2036.    BUGS
  2037.     For years < 0 errors could occur.
  2038.  
  2039.    SEE ALSO
  2040.     GregorianWeek(),HeisWeek(),JulianWeekday(),JulianDaySmaller(),
  2041.     JulianDayDiff()
  2042.  
  2043. Date/JulianWeekday                                         Date/JulianWeekday
  2044.  
  2045.    NAME
  2046.     JulianWeekday -- Gets the weekday of a specified date. (V33)
  2047.  
  2048.    SYNOPSIS
  2049.     weekday := JulianWeekday(day,month,year);
  2050.  
  2051.     PROCEDURE JulianWeekday(day,month : SHORTCARD;
  2052.         year : INTEGER) : Weekday;
  2053.  
  2054.    FUNCTION
  2055.     JulianWeekday gets the weekday for a specified date.
  2056.  
  2057.    INPUTS
  2058.     day   - day of the date
  2059.     month - month of the date
  2060.     year  - year of the date
  2061.  
  2062.    RESULT
  2063.     weekday - This result is of type:
  2064.         Weekdays := (dayerr,Monday,Tuesday,Wednesday,Thursday,Friday,
  2065.         Saturday,Sunday);
  2066.         dayerr will show you, that an error occurs!
  2067.  
  2068.    EXAMPLE
  2069.     ...
  2070.     weekday := JulianWeekday(4,10,1582);
  2071.     IF weekday = dayerr THEN
  2072.     ...
  2073.     END;
  2074.     ...
  2075.  
  2076.    NOTES
  2077.     It is better only to use this function for years from 0 to 1582!
  2078.     In this version no dayerr will occur!
  2079.  
  2080.    BUGS
  2081.     For years < 0 errors could occur, or systemcrashs(?).
  2082.  
  2083.    SEE ALSO
  2084.     GregorianWeekday(),HeisWeekday()
  2085.  
  2086. Date/JulianYearDays                                       Date/JulianYearDays
  2087.  
  2088.    NAME
  2089.     JulianYearDays -- Gives back the number of days in a year. (V33)
  2090.  
  2091.    SYNOPSIS
  2092.     days := JulianYearDays(year);
  2093.  
  2094.     PROCEDURE JulianYearDays(year : INTEGER) : CARDINAL;
  2095.  
  2096.    FUNCTION
  2097.     JulianYearDays gives you back the number of days in
  2098.     a specified year.
  2099.  
  2100.    INPUTS
  2101.     year  - The year in which to count the days.
  2102.  
  2103.    RESULT
  2104.     days - The number of days the year uses.
  2105.  
  2106.    EXAMPLE
  2107.     ...
  2108.     days := JulianYearDays(1994);
  2109.     WriteString("Days of 1994 : ");
  2110.     WriteCard(days,3); WriteLn;
  2111.     ...
  2112.  
  2113.    NOTES
  2114.     It is better only to use this function for years from -7 to 1581!
  2115.  
  2116.    BUGS
  2117.     No known bugs.
  2118.  
  2119.    SEE ALSO
  2120.     JulianMonthDays(),GregorianYearDays(),HeisYearDays()
  2121.  
  2122. Date/JYearToScaliger                                     Date/JYearToScaliger
  2123.  
  2124.    NAME
  2125.     JYearToScaliger -- Returns the year as Scaliger year. (V33)
  2126.  
  2127.    SYNOPSIS
  2128.     syear := JYearToScaliger(year);
  2129.  
  2130.     PROCEDURE JYearToScaliger(year : INTEGER) : CARDINAL;
  2131.  
  2132.    FUNCTION
  2133.     Returns the Scaliger year.
  2134.  
  2135.    INPUTS
  2136.     year     - Julian year
  2137.  
  2138.    RESULT
  2139.     syear - The Scaliger year
  2140.  
  2141.    EXAMPLE
  2142.     ...
  2143.     syear := JYearToScaliger(1582);
  2144.     ...
  2145.  
  2146.    NOTES
  2147.     It is better to use this function only from -7 to 1582!
  2148.  
  2149.    BUGS
  2150.     unknown.
  2151.  
  2152.    SEE ALSO
  2153.     GYearToScaliger(),HYearToScaliger()
  2154.  
  2155. Date/LMT                                                             Date/LMT
  2156.  
  2157.    NAME
  2158.     LMT -- Calculates your local time in your timezone (V33)
  2159.  
  2160.    SYNOPSIS
  2161.     secs := LMT(secs,meridian,pos);
  2162.  
  2163.     PROCEDURE LMT(secs : LONGCARD; meridiandegree,
  2164.         posdegree : REAL) : LONGINT;
  2165.  
  2166.    FUNCTION
  2167.     Calculates your Local Mean Time of you place!
  2168.  
  2169.    INPUTS
  2170.     secs     - Seconds of the running day (hours*3600+min*60+sec)
  2171.     meridian - Degrees of your timezone-meridian
  2172.     pos      - Degrees of your place
  2173.  
  2174.    RESULT
  2175.     secs - Local seconds of the running day
  2176.  
  2177.    EXAMPLE
  2178.     ...
  2179.     secs := LMT(76080,15.0,8.923055556);
  2180.     ...
  2181.  
  2182.    NOTES
  2183.     none
  2184.  
  2185.    BUGS
  2186.     No errorcheck, if you put in valid degrees (-180 to +180)
  2187.  
  2188.    SEE ALSO
  2189.  
  2190.  
  2191. Date/MJDtoJD                                                     Date/MJDtoJD
  2192.  
  2193.    NAME
  2194.     MJDtoJD -- Switches from MJD to JD. (V33)
  2195.  
  2196.    SYNOPSIS
  2197.     jd := MJDtoJD(mjd);
  2198.  
  2199.     PROCEDURE MJDtoJD(mjd : LONGCARD) : LONGCARD;
  2200.  
  2201.    FUNCTION
  2202.     Returns the Julianday of a Modified Julianday.
  2203.  
  2204.    INPUTS
  2205.     mjd - Modified Julianday
  2206.  
  2207.    RESULT
  2208.     jd - The Julianday
  2209.  
  2210.    EXAMPLE
  2211.     ...
  2212.     jd := JDtoMJD(49353);
  2213.     ...
  2214.  
  2215.    NOTES
  2216.     none
  2217.  
  2218.    BUGS
  2219.     unknown.
  2220.  
  2221.    SEE ALSO
  2222.     MJDtoJD()
  2223.  
  2224. Date/ScaligerYearToG                                     Date/ScaligerYearToG
  2225.  
  2226.    NAME
  2227.     ScaligerYearToG -- Returns the Scaliger year as Gregorian year. (V33)
  2228.  
  2229.    SYNOPSIS
  2230.     year := ScaligerYearToG(syear);
  2231.  
  2232.     PROCEDURE ScaligerYearToG(syear : CARDINAL) : INTEGER;
  2233.  
  2234.    FUNCTION
  2235.     Returns the Gregorian year of a Scaliger year.
  2236.  
  2237.    INPUTS
  2238.     syear     - Scaliger year
  2239.  
  2240.    RESULT
  2241.     year - The Gregorian year
  2242.  
  2243.    EXAMPLE
  2244.     ...
  2245.     year := ScaligerYearToG(6400);
  2246.     ...
  2247.  
  2248.    NOTES
  2249.     It is better to use this function only from 4707 to 7981!
  2250.  
  2251.    BUGS
  2252.     unknown.
  2253.  
  2254.    SEE ALSO
  2255.     ScaligerYearToJ(),ScaligerYearToH()
  2256.  
  2257. Date/ScaligerYearToH                                     Date/ScaligerYearToH
  2258.  
  2259.    NAME
  2260.     ScaligerYearToH -- Returns the Scaliger year as Heis year. (V33)
  2261.  
  2262.    SYNOPSIS
  2263.     year := ScaligerYearToH(syear);
  2264.  
  2265.     PROCEDURE ScaligerYearToH(syear : CARDINAL) : INTEGER;
  2266.  
  2267.    FUNCTION
  2268.     Returns the Heis year of a Scaliger year.
  2269.  
  2270.    INPUTS
  2271.     syear     - Scaliger year
  2272.  
  2273.    RESULT
  2274.     year - The Heis year
  2275.  
  2276.    EXAMPLE
  2277.     ...
  2278.     year := ScaligerYearToH(7000);
  2279.     ...
  2280.  
  2281.    NOTES
  2282.     It is better to use this function only from 4707 to 7981!
  2283.  
  2284.    BUGS
  2285.     unknown.
  2286.  
  2287.    SEE ALSO
  2288.     ScaligerYearToJ(),ScaligerYearToG()
  2289.  
  2290. Date/ScaligerYearToJ                                     Date/ScaligerYearToJ
  2291.  
  2292.    NAME
  2293.     ScaligerYearToJ -- Returns the Scaliger year as Julian year. (V33)
  2294.  
  2295.    SYNOPSIS
  2296.     year := ScaligerYearToJ(syear);
  2297.  
  2298.     PROCEDURE ScaligerYearToJ(syear : CARDINAL) : INTEGER;
  2299.  
  2300.    FUNCTION
  2301.     Returns the Julian year of a Scaliger year.
  2302.  
  2303.    INPUTS
  2304.     syear     - Scaliger year
  2305.  
  2306.    RESULT
  2307.     year - The Julian year
  2308.  
  2309.    EXAMPLE
  2310.     ...
  2311.     year := ScaligerYearToJ(4800);
  2312.     ...
  2313.  
  2314.    NOTES
  2315.     It is better to use this function only from 4707 to 6295!
  2316.  
  2317.    BUGS
  2318.     unknown.
  2319.  
  2320.    SEE ALSO
  2321.     ScaligerYearToG(),ScaligerYearToH()
  2322.  
  2323. Date/SecToTime                                                 Date/SecToTime
  2324.  
  2325.    NAME
  2326.     SecToTime -- Returns the time from seconds (V33)
  2327.  
  2328.    SYNOPSIS
  2329.     SecToTime(secs,hour,min,sec);
  2330.  
  2331.     PROCEDURE SecToTime(secs : LONGCARD; VAR hour,min,sec : SHORTCARD);
  2332.  
  2333.    FUNCTION
  2334.     Gives you back the time from the specified seconds
  2335.  
  2336.    INPUTS
  2337.     secs - Time in seconds
  2338.  
  2339.    RESULT
  2340.     hour - hours (0-23)
  2341.     min  - minutes (0-59)
  2342.     sec  - seconds (0-59)
  2343.  
  2344.    EXAMPLE
  2345.     ...
  2346.     SecToTime(76860,hour,min,sec);
  2347.     ...
  2348.  
  2349.    NOTES
  2350.     Don't forget to convert 24h time to AM/PM time if needed!
  2351.  
  2352.    BUGS
  2353.     No errorcheck, if you use a valid time
  2354.  
  2355.    SEE ALSO
  2356.     TimeToSec()
  2357.  
  2358. Date/TimeToJD                                                   Date/TimeToJD
  2359.  
  2360.    NAME
  2361.     TimeToJD -- Returns the JD for a time. (V33)
  2362.  
  2363.    SYNOPSIS
  2364.     jd := TimeToJD(hour,min,sec);
  2365.  
  2366.     PROCEDURE TimeToJD(hour,min,sec : SHORTCARD) : REAL;
  2367.  
  2368.    FUNCTION
  2369.     Returns the JD for a specified time.
  2370.  
  2371.    INPUTS
  2372.     hour - hour of the time to convert
  2373.     min  - minute of the time to convert
  2374.     sec  - sec. of the time to convert
  2375.  
  2376.    RESULT
  2377.     jd - This is the JD time
  2378.  
  2379.    EXAMPLE
  2380.     ...
  2381.     jd := TimeToJD(16,33,0);
  2382.     ...
  2383.  
  2384.    NOTES
  2385.     none
  2386.  
  2387.    BUGS
  2388.     There is no check, if the specified time is a valid time!
  2389.  
  2390.    SEE ALSO
  2391.     JDToTime()
  2392.  
  2393. Date/TimeToSec                                                 Date/TimeToSec
  2394.  
  2395.    NAME
  2396.     TimeToSec -- Returns the time in seconds (V33)
  2397.  
  2398.    SYNOPSIS
  2399.     secs := TimeToSec(hour,min,sec);
  2400.  
  2401.     PROCEDURE TimeToSec(hour,min,sec : SHORTCARD) : LONGCARD;
  2402.  
  2403.    FUNCTION
  2404.     Gives you back the time in seconds
  2405.  
  2406.    INPUTS
  2407.     hour - hours you want (0-23)
  2408.     min  - minutes you want (0-59)
  2409.     sec  - seconds you want (0-59)
  2410.  
  2411.    RESULT
  2412.     secs - Time in seconds
  2413.  
  2414.    EXAMPLE
  2415.     ...
  2416.     secs := TimeToSec(21,15,00);
  2417.     ...
  2418.  
  2419.    NOTES
  2420.     Don't forget to convert AM/PM time to 24h time!
  2421.  
  2422.    BUGS
  2423.     No errorcheck, if you use a valid time
  2424.  
  2425.    SEE ALSO
  2426.     SecToTime()
  2427.  
  2428. Date/TimeZoneFactor                                       Date/TimeZoneFactor
  2429.  
  2430.    NAME
  2431.     TimeZoneFactor -- Returns the value you have to add to GMT time (V33)
  2432.  
  2433.    SYNOPSIS
  2434.     addhours := TimeZoneFactor(degrees);
  2435.  
  2436.     PROCEDURE TimeZoneFactor(degree : SHORTINT) : SHORTINT;
  2437.  
  2438.    FUNCTION
  2439.     This gives you the hours you have to add to GMT time,
  2440.     specified on the fact, that a timezone is 15 degrees
  2441.     and that GMT is centered on 0 degrees!
  2442.  
  2443.    INPUTS
  2444.     degrees - Position of timezone you live in (from -180 to +180)
  2445.  
  2446.    RESULT
  2447.     addhours - Time to add to GMT time to get your locale zone time
  2448.         (-12 to +12)
  2449.  
  2450.    EXAMPLE
  2451.     ...
  2452.     addhours := TimeZoneFactor(-8);
  2453.     ...
  2454.  
  2455.    NOTES
  2456.     none
  2457.  
  2458.    BUGS
  2459.     No errorcheck, if you put in valid degrees (-180 to +180).
  2460.     Only full degrees are supportet, keep sure that you
  2461.     round in the right way for 0.x degree places
  2462.     I am not sure about the correct +/- behaviour!!!
  2463.  
  2464.    SEE ALSO
  2465.  
  2466.  
  2467.